#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int f(int n){

    if(n < 1){

        printf("failed the n should be positive integer.\n");
        return EXIT_FAILURE;
    }else if(n == 1){
        return 1;
    }
    return 2 * f(n-1) + 1;
}
int
main(int argc,char * argv[]){
    if(argc < 2){
        printf("need 1 position integer.\n");
        return EXIT_FAILURE;
    }
    int n = (int)strtol(argv[1],NULL,10);
    int sum = f(n);
    printf("f(%d) = %d.\n",n,sum);
    return 0;
}